package com.wkbb.common.enums;

/**
 * @author luowenyan
 * @version V1.0
 * @className FromTypeEnum
 * @description
 * @date 2019/8/1 11:04
 */
public enum FromTypeEnum {
    /**
     * 登录
     */
    LOGIN(1,"登录"),
    /**
     * 验证旧手机号
     */
    VERIFY_OLD_MOBILE(2,"验证旧手机号"),
    /**
     * 更改手机号
     */
    EDIT_MOBILE(3,"更改手机号");

    private FromTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private Integer value;

    private String desc;

    public Integer getValue() {
        return this.value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return this.desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (FromTypeEnum fromType : FromTypeEnum.values()) {
            if (fromType.getValue().intValue() == value.intValue()) {
                return fromType.getDesc();
            }
        }
        return null;
    }
}
